package com.beehoo.dcportal.common;

import com.beehoo.dcportal.common.base.BaseAction;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class PortalInterceptor extends AbstractInterceptor {

	private static final long serialVersionUID = -455233339448385922L;

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		BaseAction action = (BaseAction) invocation.getAction();
		String resCode = action.init();
		
		if(BaseAction.SUCCESS.equals(resCode)){
			return invocation.invoke();
		}else{
			return Constant.AR_DOESNOTEXISTPAGE;
		}
	}
}
